/*
 * Copyright 2008 Federal Emergency Management Agency
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); 
 * you may not use this file except in compliance with the License. 
 * You may obtain a copy of the License at 
 * 
 *    http://www.apache.org/licenses/LICENSE-2.0 
 *    
 * Unless required by applicable law or agreed to in writing, software 
 * distributed under the License is distributed on an "AS IS" BASIS, 
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and 
 * limitations under the License. 
 *  
 */
package gov.fema.hazus.bdc.server.servlet;

import java.util.Iterator;
import java.util.List;

import javax.jdo.Query;

import gov.fema.hazus.bdc.client.common.BuildingQuery;
import gov.fema.hazus.bdc.client.common.BuildingResults;
import gov.fema.hazus.bdc.client.search.SearchService;
import gov.fema.hazus.bdc.client.services.ServerException;
import gov.fema.hazus.bdc.server.dto.DTO_Building;

import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
import com.google.gwt.user.server.rpc.RemoteServiceServlet;

public class SearchServlet extends RemoteServiceServlet implements SearchService {

	private static final long serialVersionUID = -4815316747782496233L;

	public SearchServlet()
    {
        
    }

	public BuildingResults search(BuildingQuery query) throws ServerException {

		/*
		Query query = pm.newQuery(DTO_Building.class);
		query.setFilter("terms == '"+queryString+"'");
	    List<DTO_Building> results = (List<DTO_Building>) query.execute();
	    for (Iterator iterator = results.iterator(); iterator.hasNext();) {
			DTO_Building dtoBuilding = (DTO_Building) iterator.next();
			res.getWriter().println("building match=" + dtoBuilding.getName());
		}
		*/
		return null;
	    
	}


    
}
